package game.Map;

public class Tile {
    private int mode;
    private int tileIndex;

    public enum TileMode {
        normalfloorwithoutsound((byte) 0x00),
        wall((byte) 0x01),
        obstacle((byte) 0x02),
        wallwithoutshadow((byte) 0x03),
        obstaclewithoutshadow((byte) 0x04),
        wallthatisrenderedatfloorlevel((byte) 0x05),
        floordirt((byte) 0x0A),
        floorsnowwithfootprintsandfx((byte) 0x0B),
        floorstep((byte) 0x0C),
        floortile((byte) 0x0D),
        floorwadewaterwithwavefx((byte) 0x0E),
        floormetal((byte) 0x0F),
        floorwood((byte) 0x10),
        deadlynormal((byte) 0x32),
        deadlytoxic((byte) 0x33),
        deadlyexplosion((byte) 0x34),
        deadlyabyss((byte) 0x35);

        private final byte value;

        TileMode(byte value) {
            this.value = value;
        }

        public byte getValue() {
            return this.value;
        }
    }

    public Tile(int mode, int idx) {
        this.mode = mode;
        this.tileIndex = idx;
    }

    public boolean isWalkable() {
        return (mode == 0 || (mode > 5 && mode < 50));
    }

    public boolean isWall() {
        return (mode == 1 || mode == 3 || mode == 5);
    }

    public void setWalkable(int mode) {
        this.mode = mode;
    }

    public int getTileIndex() {
        return tileIndex;
    }

    public void setTileIndex(int tileIndex) {
        this.tileIndex = tileIndex;
    }
}
